<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.tjsinfo.tjsoa.workplan.vo.WorkPlanDefine"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<base href="<%=basePath%>" />

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="style/txlz7.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
		<style type="text/css">

	td {
	font:12px/170% "宋体", "新宋体", "黑体"; color:#000
}
		th {
	font:12px/170% "宋体", "新宋体", "黑体"; color:#000
}
.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 1000px;
			height: 800px;
			background-color: gray;
			z-index:1001;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=80);
}

/* 添加任务div样式 */
	.tree {
	display: none;
	position: absolute;
	top: 25%;
	left: 30%;
	width: 253px;
	height: 235px;
	border: 1px solid #11557B;
	border-bottom: block;
	background-color: #E2F7FF;
	z-index: 1003;
	overflow: auto;
}

.title {
	display: none;
	position: absolute;
	top: 21%;
	left: 30%;
	width: 255px;
	height: 205px;
	border: 0px solid #000;
	border-bottom: none;
	background-color: #E2F7FF;
	z-index: 1003;
	overflow: auto;
}

  .prog-border {
  height: 15px;
  width: 205px;
  background: #fff;
  border: 1px solid #000;
  margin: 0;
  padding: 0;
  }

  .prog-bar {
  height: 11px;
  margin: 2px;
  padding: 0px;
  background: #178399;
  font-size: 10pt;
  }

  </style>
		<script type="text/javascript" src="<%=basePath%>FCKeditor/fckeditor.js"></script>
		<script type="text/javascript" src="<%=basePath%>js/selectDateTime.js"></script>
		<script src="<%=basePath %>js/xyTree/DivTree.js"></script>
		<script src="<%=basePath %>js/xyTree/Tree.js"></script>
		<script src="<%=basePath %>js/xyTree/Node.js"></script>
		<script src="<%=basePath %>js/xyTree/js/peoples.js"></script>
		<script src="<%=basePath %>js/xyTree/Node.js"></script>
		<script type="text/javascript">
		function submitform1()
		{
			var contest = $("#contest").val();
			if(contest==""){
				Ext.MessageBox.show({ title:Ext.systemTitle,
				   msg: '工作计划的内容不能为空！',
				   buttons: Ext.Msg.OK,						  					
				   icon: Ext.MessageBox.INFO
				});
			}else{
		     	document.form1.submit();	
			}
			
		}
			//初始化方法
			function init(){
				  		
				  document.getElementById('ceshi5').appendChild(treeFenju2.div);
	 			  treeFenju2.init();//初始化方法不同
	 			  document.getElementById('tree').style.display='none';
				  document.getElementById('fade').style.display='none';
				  document.getElementById('ceshi5').style.display='none';
				  // document.getElementById('center').style.display='none';
			}


				//返回选中的记录（叶节点）
			function test3(){
 				 var a =treeFenju2.getNodesMoji();
  				 if(a.length>0) {
  				//  alert(a);
  				var temp=a.toString();
  				var user=temp.split(',');
  	var names=",";
  	var ids=",";
	  	for(var i=0;i<user.length;i++){
	  		var str=user[i];
	  		var s=str.split('.');
	  		if(document.getElementById('jubaorename').value.indexOf(s[1]) == -1)
	  		{
	  			 document.getElementById('jubaorename').value+=s[1]+",";
	  			 if(document.getElementById('jubaorenid').value == "")
	  			 {
	  			 	document.getElementById('jubaorenid').value+= ","+s[0]+",";
	  			 }
	  			 else
	  			 {
	  			 	document.getElementById('jubaorenid').value+= s[0]+",";
	  			 }
				 	
	  		}	
	  	}
	  	// alert(ids);
	  	//  alert(names);

	document.getElementById('tree').style.display='none';
	document.getElementById('fade').style.display='none';
	document.getElementById('ceshi5').style.display='none';
	
  	}else{
		document.getElementById('tree').style.display='none';
		document.getElementById('fade').style.display='none';
		document.getElementById('ceshi5').style.display='none';
		
	}; 
}
		function select()
		{
			 document.getElementById('tree').style.display='block';
				  document.getElementById('fade').style.display='block';
				   document.getElementById('ceshi5').style.display='block';
				  // document.getElementById('center').style.display='block';
		}
		function qingkong()
		{
			document.getElementById('jubaorename').value= "";
			document.getElementById('jubaorenid').value= "";	
		}
//定义初始化程序
window.onload = init;	
		</script>
		
	</head>

	<body>
		<%
			String type = (String) request.getAttribute("type");
			String defineid = (String) request.getAttribute("define");
			//Integer number = (Integer) request.getAttribute("number");
			// Integer year = (Integer) request.getAttribute("year");
			String time = (String) request.getAttribute("time");
			String definename = (String)request.getAttribute("definename");
		%>
		<form action="<%=basePath%>tjsinfo/tjsoa/workplan/addWorkPlan.do"
			method="post" name="form1">
			<div id="right" style="height: 93%">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td background="images/contacttitle01.gif" width="28" height="26"></td>
						<td class="td1px">
							新建工作计划
						</td>
						<td background="images/contacttitle03.gif" width="72" height="26">
							&nbsp;
						</td>
					</tr>
				</table>
				<div class="contact_content">
					<div class="tab_add">
						<table width="100%" border="0" cellspacing="0" class="tab_add01">
							<tr>
								<td>
									年份:
									<select name="number">
										<%
											for(int i =2000;i<=2050;i++)
											{
										%>
											<option value="<%=i %>"><%=i %>年</option>
										<% 		
											}
										%>
									</select>	
								</td>
							</tr>
							<tr>
								<td>
									请选择授权用户：
									<input readonly="readonly" name="jubaorename" type="text" value="<%=definename +","%>" size="62" id="jubaorename"/>&nbsp;<a href="javascript:select()" ><img  src="<%=basePath%>images/icon100.gif"/></a>
								</td>
							</tr>
							<tr>
								<td>
									工作计划的具体内容：
								</td>
							</tr>
							<tr>
								<td>
									<table width="99%" border="0" cellspacing="0" cellpadding="0"
										class="texttab">
										<tr>
											<td>
												<textarea name="contest" id="contest"
													style="width: 100%; height: 30px;"></textarea>
												<%--<script type="text/javascript">
													var oFCKeditor = new FCKeditor( 'contest' ) ;
													oFCKeditor.BasePath = 'FCKeditor/' ;
													oFCKeditor.ToolbarSet = 'Default' ;
													oFCKeditor.Width = '98%' ;
													oFCKeditor.Height = '350' ;
													oFCKeditor.Value = '' ;
													oFCKeditor.ReplaceTextarea(); 
													//oFCKeditor.Create() ;
						                         </script>
											--%></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<th>
									<div align="center">
										<a href="javascript:submitform1();" ><img src="images/baocun.gif" width="71"
												height="21" border="0" /> </a>&nbsp;&nbsp;&nbsp;&nbsp;
										<a href="javascript:history.go(-1);" ><img src="images/qx.gif" width="71"
												height="21" border="0" /> </a>
									</div>
								</th>
							</tr>
						</table>
						<input type="hidden" name="typename" value="<%=type%>" />
						<input type="hidden" name="type" value="<%=type%>" />
						
						<input type="hidden" name="year" value="<%=2008%>" />
						<input type="hidden" name="jubaorenid" id="jubaorenid" value="<%=defineid%>" />
						<br />
						<input type="hidden" name="time" value="<%=time%>" />
						<br />
					</div>
				</div>
			</div>
		</form>
 <div id="tree" class="tree">
			<div id="ceshi5" style="padding-left: 5px; padding-top: 5px;"></div>
			<div align="center">
				<input type="button" value="确定人选" onclick="test3()" />
			</div>
		</div>
		<div id="fade" class="black_overlays"></div>
	</body>
</html>
